package com.service;

import com.entities.CommonResult;
import com.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Description:
 *
 * @Autor: Rolin
 * datetime: 04-26-19:33
 */
@Service
@FeignClient(value = "PAYMENT-CLIENT")
public interface FeignService {

    @GetMapping("/payment/get/{id}")
    public abstract CommonResult<Payment> getById(@PathVariable("id")Long id);

    @PostMapping("/payment/insert")
    //注意，单一启动需要吧@RequestBody 注解去掉.
    public abstract CommonResult<Payment> create(@RequestBody Payment payment);

    //此处测试payment的超时功能
    @GetMapping("/payment/timeout")
    public abstract String timeoutTest();
}
